package com.example.administrator.twopagelibrary.presenter.fragment;


import com.example.administrator.commonlibrary.bean.MyBean;
import com.example.administrator.commonlibrary.contract.fragment.two.TwoFragmentContract;
import com.example.administrator.commonlibrary.networkframework.consumer.MyConsumer;
import com.example.administrator.commonlibrary.networkframework.ResponseListBean;
import com.example.administrator.commonlibrary.utils.ToastUtils;
import com.example.administrator.twopagelibrary.twobase.TwoBasePresenterImpl;

import javax.inject.Inject;

public class TwoFragmentPresenter extends TwoBasePresenterImpl<TwoFragmentContract.View> implements TwoFragmentContract.Presenter {

    @Inject
    public TwoFragmentPresenter(){
    }

    @Override
    protected void attachView() {
        mView.showLoadingDialog();
        addSubscription(flowable.getHomegData(), new MyConsumer<ResponseListBean<MyBean>>() {
            @Override
            public void onNoxt(ResponseListBean<MyBean> accept){
                mView.dismissLoadingDialog();
                ToastUtils.showToast("请求网络"+accept.getMessage());
            }

            @Override
            public void onError(String mag) {
                ToastUtils.showToast(mag);
            }
        });
    }
}
